# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=tomcatwardeployer
pkgver=98.4535e64
pkgrel=3
pkgdesc='Apache Tomcat auto WAR deployment & pwning penetration testing tool.'
groups=('blackarch' 'blackarch-exploitation' 'blackarch-automation'
        'blackarch-webapp')
arch=('any')
url='https://github.com/mgeeky/tomcatWarDeployer'
license=('GPL3')
depends=('python2' 'python2-beautifulsoup3' 'python2-beautifulsoup4'
         'python2-mechanize')
makedepends=('git')
source=("$pkgname::git+https://github.com/mgeeky/tomcatWarDeployer.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|/bin/python|/bin/python2|' tomcatWarDeployer.py
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 tomcatWarDeployer.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" screen1.png
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

